<style>
    form li{
        list-style: none;
    }
</style>
<?php
$this->title = "Adicionar nova movimentação";
$this->headTitle($this->title);
?>
<br/>
<form class="frmMov" action="<?php echo $this->form->getAction();?>" method="POST">
    <?php echo $this->form->id; ?>
    <?php echo $this->form->documento_id; ?>
    <?php echo $this->form->responsavel_id; ?>
    <?php echo $this->form->dt_criacao; ?>
    <?php if(count($this->data)==0): ?>
        <?php echo $this->form->origem; ?>
    <?php endif; ?>
    <?php echo $this->form->destino; ?>
    <?php echo $this->form->historico; ?>
    <li>
        <label for="submit"  class="leftalign"></label>
        <input type="submit" value="Salvar"/>
        <input class="btnCancelar" type="button" value="Cancelar"/>
    </li>
</form>

<script>
    
    $('#dt_criacao').live('focus', function(){
        $(this).datepicker();
    });

    $(".frmMov").submit(function() {
        var $this = $(this);

        $.post(this.action, $this.serialize(), 
            function(data){
                $this.parent().parent().html(data);
                botoes();
            });
        return false;
    });      
    
    $('.btnCancelar').click(function(){
            $(this).parent().parent().parent().html('');
    });
    
    
</script>
